<template>
  <div class="swiper-container">
    <div class="swiper-wrapper">
      <slot></slot>
    </div>
    <div class="swiper-pagination"></div>
  </div>
</template>

<script>
import Swiper from "swiper/swiper-bundle.js"; //引入js
import "swiper/swiper-bundle.min.css"; //引入css
export default {
  data() {
    return {
      swiper: null,
    };
  },
  updated() {
    if (!this.swiper)
      this.swiper = new Swiper(".swiper-container", {
        loop: true,
        autoplay: {
          disableOnInteraction: false,
        },
        pagination: {
          el: ".swiper-pagination",
        },
      });
  },
};
</script>
